package com.sun.entity;

import cn.afterturn.easypoi.excel.annotation.Excel;
import cn.afterturn.easypoi.excel.annotation.ExcelTarget;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ExcelTarget("enhanceUserExcel")
@TableName("enhance_user_info_excel")
public class EnhanceUserExcel implements Serializable {

    @TableId(type= IdType.AUTO)
    @Excel(name = "用户编号", width = 30)
    private Integer id;


    @NotNull(message = "用户名称不能为空")
    @TableField("user_name")
    @Excel(name = "用户名称", width = 30)
    private String userName;

    @TableField("user_address")
    @Excel(name = "用户住址", width = 30)
    private String userAddress;

    @TableField("user_email")
    @Excel(name = "用户邮箱", width = 30)
    private String userEmail;


    @TableField("user_status")
    @Excel(name = "用户状态",replace = {"启用_0","禁用_1"},addressList = true)
    private String userStatus;


    @TableField("user_sex")
    @Excel(name = "用户性别",replace = {"男_0","女_1","其它_2"},addressList = true)
    private String userSex;


    @TableField("create_time")
    @Excel(name = "用户创建时间",databaseFormat = "yyyyMMddHHmmss",format = "yyyy-MM-dd", width = 40)
    private Date createTime;


    @TableField("update_time")
    @Excel(name = "用户更新时间",databaseFormat = "yyyyMMddHHmmss",format = "yyyy-MM-dd", width = 40)
    private Date updateTime;

}

